const NotFound = () => import('./views/common/404.vue');
const Login = () => import('./views/common/Login.vue');
const Home = () => import('./views/Home.vue');
const About = () => import('./views/About.vue');
//const projectList = () => import('./views/Projectlist.vue');
const lyzdProjectLists = () => import('./views/common/lyzd_frontend/project/lyzd_project.vue');
const lyzdModelList = () => import('./views/common/lyzd_frontend/model/lyzd_model.vue');
const lyzdEnvironmentList = () => import('./views/common/lyzd_frontend/environment/lyzd_environment.vue');

const dingdingSetting = () => import('./views/common/lyzd_frontend/setting/dingdingSetting.vue');


const lyzdInterfaceList = () => import('./views/common/lyzd_frontend/interface/lyzd_interface.vue');
const lyzdCaseList = () => import('./views/common/lyzd_frontend/case/lyzd_case.vue');
const lyzdCaseListCG = () => import('./views/common/lyzd_frontend/case/lyzd_caseCG.vue');
const Backup = () => import('./views/common/lyzd_frontend/database/databaseBackUp.vue');
const RSADecrypt = () => import('./views/common/lyzd_frontend/littleTools/RSADecrypt.vue');

const jsonToXml = () => import('./views/common/lyzd_frontend/littleTools/jsonToXml.vue');

const drag = () => import('./views/common/lyzd_frontend/littleTools/drag.vue');


const PMout = () => import('./views/common/lyzd_frontend/littleTools/PMout.vue');
const encryption = () => import('./views/common/lyzd_frontend/encryption/encryption.vue');
const addCase = () => import('./views/common/lyzd_frontend/case/addCase.vue');
const runApiCase = () => import('./views/common/lyzd_frontend/case/runApiCase.vue');
const ProcesstTesting = () => import('./views/common/lyzd_frontend/case/processTesting.vue');

const report = () => import('./views/common/lyzd_frontend/report/report.vue');
//迁移代码
const getResult = () => import('./views/common/lyzd_frontend/interface/getResult.vue');
const addInterface = () => import('./views/common/lyzd_frontend/interface/AddInterface.vue');
const ProjectInfo = () => import('./views/Project.vue')
const api_script = () => import('./views/common/lyzd_frontend/apiScript/apiScript.vue');
const QrCode = () => import('./views/common/lyzd_frontend/QrCode/QrCode.vue');
const LyHome = () => import('./views/common/lyzd_frontend/home/LyHome.vue');

//以下引用同一个vue，内容为空只负责左侧列表下拉展示
const baseData = () => import('./views/common/lyzd_frontend/home/baseData.vue');
const ApiAndCase = () => import('./views/common/lyzd_frontend/home/baseData.vue');
const runApiTest = () => import('./views/common/lyzd_frontend/home/baseData.vue');
const others = () => import('./views/common/lyzd_frontend/home/baseData.vue');
const setting = () => import('./views/common/lyzd_frontend/home/baseData.vue');


const littleTools = () => import('./views/common/lyzd_frontend/home/littleTools.vue');


const mockAndDel = () => import('./views/common/lyzd_frontend/home/mockAndDel.vue');


const globalHost = () => import('./views/project/global/Globalhost.vue');
const API = () => import('./views/project/api/API.vue');
const ApiList = () => import('./views/project/api/ApiList.vue');
const ApiListGroup = () => import('./views/project/api/ApiListGroup.vue');
const FestTest = () => import('./views/project/api/FestTest.vue');
const addApi = () => import('./views/project/api/Addapi.vue');
const detail = () => import('./views/project/api/updateApi/ApiForm.vue');
const ApiInfo = () => import('./views/project/api/updateApi/ApiInfo.vue');
const testApi = () => import('./views/project/api/updateApi/TestApi.vue');
const UpdateApi = () => import('./views/project/api/updateApi/UpdateApi.vue');
const ApiDynamic = () => import('./views/project/api/updateApi/ApiDynamic.vue');
const AutomationTest = () => import('./views/project/automation/AutomationTest.vue');
const CaseList = () => import('./views/project/automation/CaseList.vue');
const CaseListGroup = () => import('./views/project/automation/CaseListGroup.vue');
const CaseApiList = () => import('./views/project/automation/CaseApiList.vue');
const AddCaseApi = () => import('./views/project/automation/AddCaseApi.vue');
const UpdateCaseApi = () => import('./views/project/automation/UpdateCaseApi.vue');
const TestReport = () => import('./views/project/automation/TestReport.vue');
const ProjectMember = () => import('./views/project/ProjectMember.vue');
const ProjectDynamic = () => import('./views/project/ProjectDynamic.vue');
const ProjectTitle = () => import('./views/project/projectTitle/ProjectTitle.vue');

//const ProjectTitles= () => import('./views/common/lyzd_frontend/home/ProjectTitles.vue');
const pici = () => import('./views/common/lyzd_frontend/report/report_detail.vue');
const echarts_report = () => import('./views/common/lyzd_frontend/report/Echarts.vue');
const UpdateInterface = () => import('./views/common/lyzd_frontend/interface/EditInterface.vue');
const InterfaceInfo = () => import('./views/common/lyzd_frontend/interface/Interfaceinfo.vue');
const InterfaceInfoCopy = () => import('./views/common/lyzd_frontend/interface/CopyInterface.vue');


const UpdateCase = () => import('./views/common/lyzd_frontend/case/editCase.vue');
const CaseInfo = () => import('./views/common/lyzd_frontend/case/caseInfo.vue');
// const databaseConfig = () => import('./views/common/lyzd_frontend/database/databaseConfigInfo.vue');
// const tableConfig = () => import('./views/common/lyzd_frontend/database/tableConfigInfo.vue');
//
// const delDatabase = () => import('./views/common/lyzd_frontend/database/tableDelete.vue');


const ProjectReport = () => import('./views/project/ProjectReport.vue');
// const register = () => import('./views/register.vue')

let routes = [
    {
        path: '/login',
        component: Login,//位置不能变了否则会报错 0
        name: '',
        hidden: true,
        projectHidden: true
    },
    // {
    //     path: '/register',//位置不能变了否则会报错1
    //     component: register,
    //     name: '',
    //     hidden: false,
    //     projectHidden: true
    // },
    {
        path: '/404',
        component: NotFound,//位置不能变了否则会报错2
        name: '',
        hidden: true,
        projectHidden: true
    },
    {
        path: '/',
        component: Home,//位置不能变了否则会报错3  *  因为home.vue配置了
        name: 'Home',

        projectHidden: false,
        children: [
            {
                path: '/LyHome', iconCls: 'fa fa-home  fa-lg fa-fw', name: '平台概况', hidden: false,
                component: LyHome,

            },

            {
                path: '/baseData',
                component: baseData,
                iconCls: 'fa fa-keyboard-o  fa-lg fa-fw',
                name: '基础数据维护',
                leaf: true,
                child: false,
                children: [
                    {
                        path: '/lyzdProjectLists',
                        component: lyzdProjectLists,
                        iconCls: 'fa fa-tasks  fa-lg fa-fw',
                        name: '项目管理',
                        hidden: true,
                    },
                    {
                        path: '/lyzdModelList',
                        component: lyzdModelList,
                        iconCls: 'fa fa-cubes  fa-lg fa-f',
                        name: '模块管理',
                        hidden: true
                    },
                    {
                        path: '/lyzdEnvironmentList',
                        component: lyzdEnvironmentList,
                        iconCls: 'fa fa-globe  fa-lg fa-fw',
                        name: '环境管理',
                        hidden: true
                    },]
            },

            {
                path: '/ApiAndCase',
                component: ApiAndCase,
                iconCls: 'fa fa-list-ol  fa-lg fa-fw',
                name: '接口用例管理',
                leaf: true,
                child: false,
                children: [
                    {
                        path: '/lyzdInterfaceList',
                component: lyzdInterfaceList,
                iconCls: 'fa fa-sitemap  fa-lg fa-fw',
                        name: '接口管理',
                        hidden: true,
                    },
                    {

                        path: '/lyzdCaseList', component: lyzdCaseList, iconCls: 'fa fa-cog  fa-lg fa-fw',

                        name: '用例管理-业务逻辑',
                        hidden: true
                    },
                    {
                          path: '/lyzdCaseListCG', component: lyzdCaseListCG, iconCls: 'fa fa-cogs  fa-lg fa-fw', name: '用例管理-常规校验',

                        hidden: true
                    },]
            },

            {
                path: '/runApiTest',
                component: runApiTest,
                iconCls: 'fa fa-indent  fa-lg fa-fw',
                name: '执行接口测试',
                leaf: true,
                child: false,
                children: [
                    {
                         path: '/runApiCase',
                component: runApiCase,
                iconCls: 'fa fa-caret-square-o-right  fa-lg fa-fw',
                name: '接口测试',
                        hidden: true,
                    },
                    {

                                   path: '/ProcesstTesting',
                component: ProcesstTesting,
                iconCls: 'fa fa-retweet  fa-lg fa-fw',
                name: '流程测试',
                        hidden: true,
                    }

                   ]
            },




            //{path: '/projectList', component: projectList, iconCls: 'el-icon-message', name: '项目列表', hidden: false},


            // {
            //     path: '/lyzdInterfaceList',
            //     component: lyzdInterfaceList,
            //     iconCls: 'fa fa-sitemap  fa-lg fa-fw',
            //     name: '接口管理',
            //     meta: {keepAlive: true}
            // },


            {path: '/addInterface', component: addInterface, iconCls: 'el-icon-message', name: '接口新增', hidden: true},

            // {path: '/lyzdCaseList', component: lyzdCaseList, iconCls: 'fa fa-cog  fa-lg fa-fw', name: '用例维护'},
            // {path: '/lyzdCaseListCG', component: lyzdCaseListCG, iconCls: 'fa fa-cogs  fa-lg fa-fw', name: '用例维护-常规'},

            {path: '/addCase', component: addCase, iconCls: 'el-icon-news', name: '用例新增', hidden: true},
            // {
            //     path: '/runApiCase',
            //     component: runApiCase,
            //     iconCls: 'fa fa-caret-square-o-right  fa-lg fa-fw',
            //     name: '接口测试执行'
            // },
            {
                path: '/report',
                component: report,
                iconCls: 'fa fa-bar-chart  fa-lg fa-fw',
                name: '测试报告',
                meta: {keepAlive: true}
            },
            {
                path: '/report_detail/pici=:pici',
                component: pici,
                iconCls: 'el-icon-news',
                name: '测试执行结果详情',
                hidden: true
            },

            {
                path: '/echarts_report/pici=:pici',
                component: echarts_report,
                iconCls: 'el-icon-news',
                name: '测试执行结果-Echarts展示',
                hidden: true
            },

            {
                path: '/interface_edit/cid=:interface_id',
                component: UpdateInterface,
                iconCls: 'el-icon-news',
                name: '接口编辑',
                hidden: true
            },
            {
                path: '/interface_info/cid=:interface_id',
                component: InterfaceInfo,
                iconCls: 'el-icon-news',
                name: '接口详情',
                hidden: true
            },
            {
                path: '/interface_info_copy/cid=:interface_id',
                component: InterfaceInfoCopy,
                iconCls: 'el-icon-news',
                name: '接口复制',
                hidden: true
            },

            {
                path: '/case_edit/cid=:case_id',
                component: UpdateCase,
                iconCls: 'el-icon-news',
                name: '用例编辑',
                hidden: true
            },
            {
                path: '/case_info/cid=:case_id',
                component: CaseInfo,
                iconCls: 'el-icon-news',
                name: '用例详情',
                hidden: true
            },


            // {
            //     path: '/api_script',
            //     component: api_script,
            //     iconCls: 'fa fa-eye  fa-lg fa-fw',
            //     name: '自动化脚本列表',
            //     hidden: false
            // },
            {
                path: '/littleTools',
                component: littleTools,
                iconCls: 'fa fa-dropbox fa-lg fa-fw',
                name: '工具箱',
                leaf: true,
                child: false,
                children: [
                    {
                        path: '/QrCode',
                        component: QrCode,
                        iconCls: 'fa fa-qrcode  fa-lg fa-fw',
                        name: '生成二维码',
                        hidden: true
                    },
                    {
                        path: '/PMout',
                        component: PMout,
                        iconCls: 'fa fa-exchange  fa-lg fa-fw',
                        name: 'PM导入导出',
                        hidden: true
                    },
                    {
                        path: '/RSADecrypt',
                        component: RSADecrypt,
                        iconCls: 'fa fa-key  fa-lg fa-fw',
                        name: 'RSA解密[GZZCD]',
                        hidden: true
                    },

                    {
                        path: '/jsonToXml',
                        component: jsonToXml,
                        iconCls: 'fa fa-refresh  fa-lg fa-fw',
                        name: 'Json⇌Xml',
                        hidden: true
                    },
                    {
                        path: '/drag',
                        component: drag,
                        iconCls: 'fa fa-refresh  fa-lg fa-fw',
                        name: 'drag',
                        hidden: true
                    }


                ]
            },

             {
                path: '/others',
                component: others,
                iconCls: 'fa fa-folder-o  fa-lg fa-fw',
                name: '其他',
                leaf: true,
                child: false,
                children: [
                    {
                       path: '/api_script',
                component: api_script,
                iconCls: 'fa fa-list  fa-lg fa-fw',
                name: '自动化脚本列表',
                        hidden: true,
                    }]
            },
            {
                path: '/setting',
                component: setting,
                iconCls: 'fa fa-cog  fa-lg fa-fw',
                name: '设置',
                leaf: true,
                child: false,
                children: [


                    {
                        path: '/dingdingSetting',
                        component: dingdingSetting,
                        iconCls: 'fa fa-twitch  fa-lg fa-fw',
                        name: '钉钉消息配置',
                        hidden: true
                    }


                    ]
            },

            // {
            //     path: '/mockAndDel', component: mockAndDel, iconCls: 'fa fa-database  fa-lg fa-fw', name: '数据备份及删除',
            //     leaf: true,
            //     child: false,
            //     children: [
            //         // {path: '/databaseConfig', component: databaseConfig, iconCls: 'fa fa-database  fa-lg fa-fw', name: '数据库配置', hidden: true},
            //         //    {path: '/Backup', component: Backup, iconCls: 'fa fa-download fa-lg fa-fw', name: '数据库备份',hidden: true},
            //         // {path: '/tableConfig', component: tableConfig, iconCls: 'fa fa-table  fa-lg fa-fw', name: '数据表配置', hidden: true},
            //         //                 // {path: '/delDatabase', component: delDatabase, iconCls: 'fa fa-trash-o  fa-lg fa-fw', name: '测试数据删除', hidden: true},
            //
            //     ]
            // },
            // {path: '/encryption', component: encryption, iconCls: 'fa fa-lock  fa-lg fa-fw', name: '龙盈加解密', hidden: false},
            //
            //  {path: '/about', component: About, iconCls: 'fa fa-star', name: '关于我们'},
            // {path: '/LyHome', component: ProjectTitles, iconCls: 'fa fa-star',name: '项目概况', leaf: true}


        ]
    },
    {
        path: '*',
        hidden: true,
        projectHidden: true,
        redirect: {path: '/404'}
    },

    // {
    //   path: '/NewRecruit',
    //   name: 'NewRecruit',
    //   component: NewRecruit,
    //   meta: {
    //     keepAlive: true
    //   }
    // },
    // {
    //   path: '/NewRecruitDesc/:id',
    //   name: 'NewRecruitDesc',
    //   component: NewRecruitDesc,
    //   meta: {
    //     keepAlive: true
    //   }
    // },
    // {
    //   path: '/SubmitSucess',
    //   name: 'SubmitSucess',
    //   component: SubmitSucess,
    //   meta: {
    //     keepAlive: false
    //   }
    // },


    /***下面原项目的暂时不用**/

    {
        path: '/project/project=:project_id',
        component: ProjectInfo,
        name: '项目',
        hidden: true,
        children: [
            //http://localhost:8080/#/ProjectTitle/project=1
            {path: '/ProjectTitle/project=:project_id', component: ProjectTitle, name: '项目概况', leaf: true},
            {path: '/GlobalHost/project=:project_id', component: globalHost, name: 'Host配置', leaf: true},
            {
                path: '/api/project=:project_id',
                component: API,
                name: 'API接口',
                leaf: true,
                child: true,
                children: [
                    {path: '/apiList/project=:project_id', component: ApiList, name: '接口列表'},
                    {path: '/apiList/project=:project_id/first=:firstGroup', component: ApiListGroup, name: '分组接口列表'},
                    {path: '/fastTest/project=:project_id', component: FestTest, name: '快速测试'},
                    {path: '/addApi/project=:project_id', component: addApi, name: '新增接口'},
                    {
                        path: '/detail/project=:project_id/api=:api_id',
                        component: detail,
                        name: '接口',
                        children: [
                            {path: '/apiInfo/project=:project_id/api=:api_id', component: ApiInfo, name: '基础信息'},
                            {path: '/testApi/project=:project_id/api=:api_id', component: testApi, name: '测试'},
                            {path: '/apiDynamic/project=:project_id/api=:api_id', component: ApiDynamic, name: '历史'},
                        ]
                    },
                    {path: '/updateApi/project=:project_id/api=:api_id', component: UpdateApi, name: '修改'},
                ]
            },
            {
                path: '/automationTest/project=:project_id',
                component: AutomationTest,
                name: '自动化测试',
                leaf: true,
                child: false,
                children: [
                    {path: '/caseList/project=:project_id', component: CaseList, name: '用例列表'},
                    {path: '/caseList/project=:project_id/first=:firstGroup', component: CaseListGroup, name: '分组用例列表'},
                    {path: '/caseApiList/project=:project_id/case=:case_id', component: CaseApiList, name: '用例接口列表'},
                    {path: '/addCaseApi/project=:project_id/case=:case_id', component: AddCaseApi, name: '添加新接口'},
                    {
                        path: '/updateCaseApi/project=:project_id/case=:case_id/api=:api_id',
                        component: UpdateCaseApi,
                        name: '修改接口'
                    },
                    {path: '/testReport/project=:project_id', component: TestReport, name: '测试报告'},
                ]
            },
            {path: '/projectMember/project=:project_id', component: ProjectMember, name: '成员管理', leaf: true},
            {path: '/projectDynamic/project=:project_id', component: ProjectDynamic, name: '项目动态', leaf: true},
            {path: '/projectReport/project=:project_id', component: ProjectReport, name: '自动化测试报告', leaf: true},
        ]
    },


];

export default routes;


